<template>
    <!-- 如果父组件想要向子组件中传入属性 ，如果传递的属性值是ts或js变量则需要用到v-bind单向绑定-->
    <!-- 
        如果要为模板绑定ts或js的数据，可以用v-bind 简称 : 
    -->
     <!-- <Person a="hello world" :b="sex"/> -->
     <!-- <Person a="hello world" :b="sex" :list="persons"/> -->
     <Person :list="persons"/>
</template>


<!-- 父组件 -->
<script setup lang="ts" name="App">
    import Person from './components/Person.vue'
    import {type PersonList } from './types/Person';
    import { reactive } from 'vue';
    //现在我想把sex属性的值传递给子组件
    let sex='男'


    let persons=reactive<PersonList>([
        {id:'j10011',name:'张三',age:25},
        {id:'j10012',name:'张四',age:25,sex:'男'},
        {id:'j10013',name:'张五',age:25},
        {id:'j10014',name:'张六',age:25},
        {id:'j10015',name:'张琪',age:25}
    ])


</script>

